module.exports = function ($scope, $modalInstance, $resource, toaster, id){

    $scope.obj = {
        'info_id' : id
    };

    //保存
	$scope.save = function() {
        if(!$scope.obj.reply_title){
			toaster.warning({title: '', body: '请填写留言名称.'});
			return false;
		}
		if(!$scope.obj.reply_content){
			toaster.warning({title: '', body: '请填写留言内容.'});
			return false;
		}
		$resource('/api/as/goc/infodiffusion/createinforeply', {}, {}).save($scope.obj, function(res){
            if (res.errcode === 0) {
                toaster.success({title: '', body: '保存成功'});
                $modalInstance.close();
            } else {
                toaster.error({title: '', body: res.errmsg});
            }
        });
    }
    
    //取消
    $scope.cannel = function () {
        $modalInstance.dismiss('cancel');
    }
    
};